<?php

/**
 * 异常处理的基类
 * http://my.oschina.net/mingtingling/blog/92104(怎么一步步编写简单的PHP的Framework-九)
 * 
 *
 */
class NoClassException extends BaseException {

	const NONE_EXISTS_METHOD = 1;
	const NONE_EXISTS_CLASS = 2;
    const NONE_EXISTS_FILE = 3;
	const NONE_EXISTS_VALUE = 4;
	const NONE_EXISTS_STATIC_METHOD = 5;
	
	public function __construct($message, $code = 0) {
		switch($code) {
            case self::NONE_EXISTS_FILE:
                $msg = 'the file does not exists';
                break;
			case self::NONE_EXISTS_METHOD:
				$msg = "the method does not exists";
				break;
			case self::NONE_EXISTS_CLASS:
				$msg = "the class does not exists";
				break;
			case self::NONE_EXISTS_VALUE:
				$msg = "the value not exists";
				break;
			case self::NONE_EXISTS_STATIC_METHOD:
				$msg = "the static method does not exists";
				break;
			default:
				$msg = "unknown error";
				break;
		}
		parent::__construct($msg . ':' . $message, $code);
	}
}